package controller.persiapan;

import controller.permainan.Permainan2;
import helper.SearchEngine;
import model.*;
import model.Game;
import model.players.Players;

public class Profiles extends javax.swing.JFrame {

    private boolean border;
    Persiapan p;
    int i = 0;
    Game g;
    CreatePlayer cp = new CreatePlayer(p);
    public static Players qp;

    //array dimulai dari satu
    javax.swing.JTextField playername_array[] = new javax.swing.JTextField[4];
    javax.swing.JLabel icon_array[] = new javax.swing.JLabel[4];
    javax.swing.JPanel player_panel[] = new javax.swing.JPanel[4];
    javax.swing.JTextArea plyrattr_textarea[] = new javax.swing.JTextArea[5]; 

    /** Creates new form Profiles */
    @SuppressWarnings("static-access")
    public Profiles(boolean border) {
        initComponents();
        this.border = border;
        this.setLocationRelativeTo(null);
        qp = new Players(cp.banyak_pemain);
        qp.jum_Player = cp.banyak_pemain;
        System.out.println(cp.banyak_pemain);
        this.initializeQ();
        this.make_array();
        this.setDisplay();        
    }

    @SuppressWarnings("static-access")
    private void initializeQ()
    {
        for(int i=1 ; i<=cp.banyak_pemain; i++)
            qp.add(cp.getPlayer(i));
    }

    @SuppressWarnings("static-access")
   
    private void make_array()
    {
        playername_array[0] = this.player1name_textfield;
        playername_array[1] = this.player2name_textfield;
        playername_array[2] = this.player3name_textfield;
        playername_array[3] = this.player4name_textfield;

        icon_array[0] = this.iconP1_label1;
        icon_array[1] = this.IconP2_label;
        icon_array[2] = this.iconp3_label;
        icon_array[3] = this.iconp4_label;

        player_panel[0] = this.P1_panel;
        player_panel[1] = this.P2_panel;
        player_panel[2] = this.P3_panel;
        player_panel[3] = this.P4_panel;

        plyrattr_textarea[1] = plyrattr_textarea1;
        plyrattr_textarea[2] = plyrattr_textarea2;
        plyrattr_textarea[3] = plyrattr_textarea3;
        plyrattr_textarea[4] = plyrattr_textarea4;

        for(int i=0;i<=3;i++)
            player_panel[i].setVisible(false);
    }

    @SuppressWarnings("static-access")
    private void setDisplay ()
    {
        for (int i = 1;i<=cp.banyak_pemain;i++)
        {
            this.playername_array[i-1].setText(qp.getPlayer(i).getNama());
            this.icon_array[i-1].setIcon(SearchEngine.createImageIcon(qp.getPlayer(i).getIkon()));
            plyrattr_textarea[i].setText(qp.getPlayer(i).getAttr());
            player_panel[i-1].setVisible(true);
        }
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        player4_panel = new javax.swing.JPanel();
        iconp4_label = new javax.swing.JLabel();
        P4_panel = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        plyrattr_textarea4 = new javax.swing.JTextArea();
        player4name_textfield = new javax.swing.JTextField();
        player1_panel = new javax.swing.JPanel();
        iconP1_label = new javax.swing.JLabel();
        P1_panel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        player1name_textfield = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        plyrattr_textarea1 = new javax.swing.JTextArea();
        iconP1_label1 = new javax.swing.JLabel();
        player3_panel = new javax.swing.JPanel();
        iconP3_label = new javax.swing.JLabel();
        P3_panel = new javax.swing.JPanel();
        player3name_textfield = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        plyrattr_textarea3 = new javax.swing.JTextArea();
        iconp3_label = new javax.swing.JLabel();
        letsplay_label = new javax.swing.JLabel();
        player2_panel = new javax.swing.JPanel();
        P2_panel = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        player2name_textfield = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        plyrattr_textarea2 = new javax.swing.JTextArea();
        IconP2_label = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setUndecorated(true);

        player4_panel.setBackground(new java.awt.Color(255, 153, 204));
        player4_panel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        player4_panel.setEnabled(false);

        iconp4_label.setPreferredSize(player4name_textfield.getPreferredSize());

        P4_panel.setBackground(new java.awt.Color(255, 153, 204));

        jLabel5.setFont(new java.awt.Font("Chiller", 0, 24));
        jLabel5.setText("Hai,");

        jScrollPane4.setBackground(new java.awt.Color(255, 153, 204));

        plyrattr_textarea4.setBackground(new java.awt.Color(255, 153, 204));
        plyrattr_textarea4.setColumns(20);
        plyrattr_textarea4.setFont(new java.awt.Font("Showcard Gothic", 0, 13));
        plyrattr_textarea4.setLineWrap(true);
        plyrattr_textarea4.setRows(5);
        plyrattr_textarea4.setText("Money  \n          50000\n  \n\nFun           \n                 20\n\n\nHunger  \n                 20\n\n\nAset         \n             -----");
        plyrattr_textarea4.setAutoscrolls(false);
        plyrattr_textarea4.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        plyrattr_textarea4.setPreferredSize(plyrattr_textarea1.getPreferredSize());
        jScrollPane4.setViewportView(plyrattr_textarea4);

        player4name_textfield.setBackground(new java.awt.Color(255, 153, 204));
        player4name_textfield.setFont(new java.awt.Font("Century", 1, 14));
        player4name_textfield.setText("name");
        player4name_textfield.setBorder(null);

        javax.swing.GroupLayout P4_panelLayout = new javax.swing.GroupLayout(P4_panel);
        P4_panel.setLayout(P4_panelLayout);
        P4_panelLayout.setHorizontalGroup(
            P4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P4_panelLayout.createSequentialGroup()
                .addGroup(P4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P4_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(player4name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(22, Short.MAX_VALUE))
        );
        P4_panelLayout.setVerticalGroup(
            P4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P4_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(P4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(player4name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout player4_panelLayout = new javax.swing.GroupLayout(player4_panel);
        player4_panel.setLayout(player4_panelLayout);
        player4_panelLayout.setHorizontalGroup(
            player4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player4_panelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(player4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(P4_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(iconp4_label, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        player4_panelLayout.setVerticalGroup(
            player4_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player4_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(P4_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(48, 48, 48)
                .addComponent(iconp4_label, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(74, Short.MAX_VALUE))
        );

        player1_panel.setBackground(new java.awt.Color(204, 255, 153));
        player1_panel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        player1_panel.setName("player1_panel"); // NOI18N
        player1_panel.setPreferredSize(new java.awt.Dimension(193, 520));

        iconP1_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconP1_labelMouseClicked(evt);
            }
        });

        P1_panel.setBackground(new java.awt.Color(204, 255, 153));

        jLabel1.setFont(new java.awt.Font("Chiller", 0, 24));
        jLabel1.setText("Hai,");

        player1name_textfield.setBackground(new java.awt.Color(204, 255, 153));
        player1name_textfield.setEditable(false);
        player1name_textfield.setFont(new java.awt.Font("Century", 1, 14));
        player1name_textfield.setText("name");
        player1name_textfield.setBorder(null);

        jScrollPane2.setBackground(new java.awt.Color(204, 255, 153));

        plyrattr_textarea1.setBackground(new java.awt.Color(204, 255, 153));
        plyrattr_textarea1.setColumns(20);
        plyrattr_textarea1.setFont(new java.awt.Font("Showcard Gothic", 0, 13));
        plyrattr_textarea1.setLineWrap(true);
        plyrattr_textarea1.setRows(5);
        plyrattr_textarea1.setText("Money   \n          50000\n\n \nFun           \n                  20\n\n\nHunger  \n                  20\n\n\nAset         \n               -----");
        plyrattr_textarea1.setAutoscrolls(false);
        plyrattr_textarea1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        plyrattr_textarea1.setPreferredSize(plyrattr_textarea3.getPreferredSize());
        jScrollPane2.setViewportView(plyrattr_textarea1);

        javax.swing.GroupLayout P1_panelLayout = new javax.swing.GroupLayout(P1_panel);
        P1_panel.setLayout(P1_panelLayout);
        P1_panelLayout.setHorizontalGroup(
            P1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P1_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(P1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P1_panelLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(player1name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(P1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                        .addComponent(iconP1_label1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE)))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        P1_panelLayout.setVerticalGroup(
            P1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P1_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(P1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(player1name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
                .addComponent(iconP1_label1, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(48, 48, 48))
        );

        javax.swing.GroupLayout player1_panelLayout = new javax.swing.GroupLayout(player1_panel);
        player1_panel.setLayout(player1_panelLayout);
        player1_panelLayout.setHorizontalGroup(
            player1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player1_panelLayout.createSequentialGroup()
                .addComponent(P1_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(iconP1_label))
        );
        player1_panelLayout.setVerticalGroup(
            player1_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player1_panelLayout.createSequentialGroup()
                .addGap(91, 91, 91)
                .addComponent(iconP1_label, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
                .addGap(248, 248, 248))
            .addGroup(player1_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(P1_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(17, Short.MAX_VALUE))
        );

        player3_panel.setBackground(new java.awt.Color(255, 153, 153));
        player3_panel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        player3_panel.setEnabled(false);

        iconP3_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconP3_labelMouseClicked(evt);
            }
        });

        P3_panel.setBackground(new java.awt.Color(255, 153, 153));

        player3name_textfield.setBackground(new java.awt.Color(255, 153, 153));
        player3name_textfield.setFont(new java.awt.Font("Century", 1, 14));
        player3name_textfield.setText("name");
        player3name_textfield.setBorder(null);

        jLabel4.setFont(new java.awt.Font("Chiller", 0, 24));
        jLabel4.setText("Hai,");

        jScrollPane3.setBackground(new java.awt.Color(255, 153, 153));

        plyrattr_textarea3.setBackground(new java.awt.Color(255, 153, 153));
        plyrattr_textarea3.setColumns(20);
        plyrattr_textarea3.setFont(new java.awt.Font("Showcard Gothic", 0, 13));
        plyrattr_textarea3.setLineWrap(true);
        plyrattr_textarea3.setRows(5);
        plyrattr_textarea3.setText("Money  \n          50000\n  \n\nFun           \n                 20\n\n\nHunger  \n                 20\n\n\nAset         \n             -----");
        plyrattr_textarea3.setAutoscrolls(false);
        plyrattr_textarea3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        plyrattr_textarea3.setPreferredSize(plyrattr_textarea1.getPreferredSize());
        jScrollPane3.setViewportView(plyrattr_textarea3);

        javax.swing.GroupLayout P3_panelLayout = new javax.swing.GroupLayout(P3_panel);
        P3_panel.setLayout(P3_panelLayout);
        P3_panelLayout.setHorizontalGroup(
            P3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P3_panelLayout.createSequentialGroup()
                .addGroup(P3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P3_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel4)
                        .addGap(10, 10, 10)
                        .addComponent(player3name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        P3_panelLayout.setVerticalGroup(
            P3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P3_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(P3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(player3name_textfield, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout player3_panelLayout = new javax.swing.GroupLayout(player3_panel);
        player3_panel.setLayout(player3_panelLayout);
        player3_panelLayout.setHorizontalGroup(
            player3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player3_panelLayout.createSequentialGroup()
                .addGroup(player3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(player3_panelLayout.createSequentialGroup()
                        .addGap(198, 198, 198)
                        .addComponent(iconP3_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(player3_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(P3_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(player3_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(iconp3_label, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        player3_panelLayout.setVerticalGroup(
            player3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player3_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(player3_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(iconP3_label)
                    .addComponent(P3_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(65, 65, 65)
                .addComponent(iconp3_label, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(55, 55, 55))
        );

        letsplay_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/model/persiapan/letsplay1.jpg"))); // NOI18N
        letsplay_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                letsplay_labelMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                letsplay_labelMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                letsplay_labelMouseExited(evt);
            }
        });

        player2_panel.setBackground(new java.awt.Color(204, 255, 255));
        player2_panel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        player2_panel.setEnabled(false);

        P2_panel.setBackground(new java.awt.Color(204, 255, 255));
        P2_panel.setPreferredSize(new java.awt.Dimension(117, 351));

        jLabel2.setFont(new java.awt.Font("Chiller", 0, 24));
        jLabel2.setText("Hai,");

        player2name_textfield.setBackground(new java.awt.Color(204, 255, 255));
        player2name_textfield.setFont(new java.awt.Font("Century", 1, 14));
        player2name_textfield.setText("name");
        player2name_textfield.setBorder(null);

        jScrollPane1.setBackground(new java.awt.Color(204, 255, 255));
        jScrollPane1.setPreferredSize(plyrattr_textarea1.getPreferredSize());

        plyrattr_textarea2.setBackground(new java.awt.Color(204, 255, 255));
        plyrattr_textarea2.setColumns(20);
        plyrattr_textarea2.setFont(new java.awt.Font("Showcard Gothic", 0, 13));
        plyrattr_textarea2.setLineWrap(true);
        plyrattr_textarea2.setRows(5);
        plyrattr_textarea2.setText("Money   \n          50000\n\n \nFun           \n                  20\n\n\nHunger  \n                  20\n\n\nAset         \n               -----");
        plyrattr_textarea2.setAutoscrolls(false);
        plyrattr_textarea2.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        plyrattr_textarea2.setPreferredSize(plyrattr_textarea3.getPreferredSize());
        jScrollPane1.setViewportView(plyrattr_textarea2);

        javax.swing.GroupLayout P2_panelLayout = new javax.swing.GroupLayout(P2_panel);
        P2_panel.setLayout(P2_panelLayout);
        P2_panelLayout.setHorizontalGroup(
            P2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P2_panelLayout.createSequentialGroup()
                .addGroup(P2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P2_panelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel2)
                        .addGap(10, 10, 10)
                        .addComponent(player2name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(18, Short.MAX_VALUE))
        );
        P2_panelLayout.setVerticalGroup(
            P2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P2_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(P2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(player2name_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        IconP2_label.setPreferredSize(player2name_textfield.getPreferredSize());

        javax.swing.GroupLayout player2_panelLayout = new javax.swing.GroupLayout(player2_panel);
        player2_panel.setLayout(player2_panelLayout);
        player2_panelLayout.setHorizontalGroup(
            player2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player2_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(player2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(P2_panel, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addGroup(player2_panelLayout.createSequentialGroup()
                        .addComponent(IconP2_label, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(21, Short.MAX_VALUE))))
        );
        player2_panelLayout.setVerticalGroup(
            player2_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(player2_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(P2_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 339, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(48, 48, 48)
                .addComponent(IconP2_label, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(57, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(letsplay_label, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(player1_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(player2_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(player3_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(player4_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(player2_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(player4_panel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(player1_panel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 660, Short.MAX_VALUE)
                    .addComponent(player3_panel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 660, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(letsplay_label)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void iconP3_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconP3_labelMouseClicked
        
}//GEN-LAST:event_iconP3_labelMouseClicked

    private void letsplay_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_letsplay_labelMouseClicked
        this.setVisible(false);    
        (new Permainan2(qp)).setVisible(true);
    }//GEN-LAST:event_letsplay_labelMouseClicked

    private void letsplay_labelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_letsplay_labelMouseEntered
        this.letsplay_label.setIcon(SearchEngine.createImageIcon("persiapan/letsplay2.jpg"));
}//GEN-LAST:event_letsplay_labelMouseEntered

    private void letsplay_labelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_letsplay_labelMouseExited
       this.letsplay_label.setIcon(SearchEngine.createImageIcon("persiapan/letsplay1.jpg"));
}//GEN-LAST:event_letsplay_labelMouseExited

    private void iconP1_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconP1_labelMouseClicked

}//GEN-LAST:event_iconP1_labelMouseClicked

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Profiles(true).setVisible(true);
            }
        });
    }

    //private javax.swing.JPanel player_panel;

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel IconP2_label;
    private javax.swing.JPanel P1_panel;
    private javax.swing.JPanel P2_panel;
    private javax.swing.JPanel P3_panel;
    private javax.swing.JPanel P4_panel;
    private javax.swing.JLabel iconP1_label;
    private javax.swing.JLabel iconP1_label1;
    private javax.swing.JLabel iconP3_label;
    private javax.swing.JLabel iconp3_label;
    private javax.swing.JLabel iconp4_label;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JLabel letsplay_label;
    private javax.swing.JPanel player1_panel;
    private javax.swing.JTextField player1name_textfield;
    private javax.swing.JPanel player2_panel;
    private javax.swing.JTextField player2name_textfield;
    private javax.swing.JPanel player3_panel;
    private javax.swing.JTextField player3name_textfield;
    private javax.swing.JPanel player4_panel;
    private javax.swing.JTextField player4name_textfield;
    private javax.swing.JTextArea plyrattr_textarea1;
    private javax.swing.JTextArea plyrattr_textarea2;
    private javax.swing.JTextArea plyrattr_textarea3;
    private javax.swing.JTextArea plyrattr_textarea4;
    // End of variables declaration//GEN-END:variables

}
